package com.jason.frescotest;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ListView;

import com.jason.frescotest.adapter.GifAdapter;
import com.jason.frescotest.bean.ImageData;
import com.jason.frescotest.utils.ImageURL;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Jason
 * @Date: 15/12/10
 * @Time: 18:41
 */

public class ListDemoActivity extends AppCompatActivity {

    private List<ImageData> list = new ArrayList<>();
    ListView listView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_list);

        listView = (ListView) findViewById(R.id.listview);


        for (int i = 0; i < ImageURL.gitUrl.length; i++) {
            list.add(new ImageData(ImageURL.gitUrl[i], 1));
        }

        for (int i = 0; i < ImageURL.imageUrl.length; i++) {
            list.add(new ImageData(ImageURL.imageUrl[i], 0));
        }

        GifAdapter adapter = new GifAdapter(list, this);


        listView.setAdapter(adapter);




    }
}
